{include file="header.html"}
<script type="text/javascript" charset="utf-8" src="../htmleditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../htmleditor/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../htmleditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
$(function(){
    $('#article_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        rules : {    
            title : {
                required : true
            },
            cate_id :{
                required : true
            },
            link    :{
                url     : true
            },
            sort_order:{
               number   : true
            },
            file_url : {
                accept  : 'gif|png|jpe?g'
            }
        },
        messages : {
            title : {
                required : '{$lang.title_empty}'
            },
            cate_id : {
                required : '{$lang.cate_empty}'
            },
            link    : {
                url     : '{$lang.link_limit}'
            },
            file_url : {
                accept : '{$lang.limit_img}'
            },
            sort_order  : {
                number   : '{$lang.number_only}'
            }
        }
    });
});

 
</script>
 
<div id="rightTop">
    <p>活动</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=activity">{$lang.manage}</a></li>
        {if $activity.act_id}
        <li><a class="btn1" href="index.php?app=activity&amp;act=add">{$lang.add}</a></li>
        {else}
        <li><span>{$lang.add}</span></li>
        {/if}
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="article_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.title}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="title" type="text" name="title" value="{$activity.title|escape}" />
                </td>
            </tr>
 
         <tr>
                <th class="paddingT15">
                    <label for="cate_id">{$lang.cat}:</label></th>
                <td class="paddingT15 wordSpacing5">
                    <select id="cat" name="cat">
                    <option value="">请选择</option>
                    {html_options options=$dis_cat selected=$activity.cat}
                    </select>
                </td>
            </tr>
      
            <tr>
                <th class="paddingT15">
                    {$lang.sort_order}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="sort_order" type="text" name="sort_order" value="{$activity.sort_order}" />
                </td>
            </tr>
                   <tr>
                <th class="paddingT15">
                    图片:</th>
                <td class="paddingT15 wordSpacing5">
                {if $activity.pic}
                 <a href="/{$activity.pic}" target="_blank"><img src="/{$activity.pic}" class="makesmall" max_width="120" max_height="90" /></a>
                {/if}
                    <input class="infoTableFile2" id="pic" type="file" name="pic" />
                    <label class="field_notice">{$lang.limit_img}</label>
                </td>
            </tr>
            
            
               <tr>
                <th class="paddingT15">
                    {$lang.subject}:</th>
                <td class="paddingT15 wordSpacing5">
                     
                    
                     <textarea id="subject" name="subject" style="width:350px;height:100px;">{$activity.subject}</textarea>
                </td>
            </tr> 
            <tr>
                <th class="paddingT15">
                    <label for="article">{$lang.content}:</label></th>
                <td class="paddingT15 wordSpacing5">                
                    <textarea id="article_content" name="article_content" style="width:650px;height:400px;">{$activity.content|escape}</textarea>
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('article_content');
</script>
                </td>
            </tr>
             
            
        <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
